#include <iostream>
using namespace std;
const int N = 100010;
int n, m;
int a[N], b[N];
void insert(int l, int r, int c)
{
    b[l] += c;  //相当于数组在l以后都+c
    b[r + 1] -= c;  //相当于数组在r以后（不包括r）都-c，最终实现l到r都+c
}
int main()
{
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++)
        insert(i, i, a[i]);  //b[i]为a[i]与a[i+1]的差，相当于i到i插入a[i]后的操作

    while (m--)
    {
        int l, r, c;
        scanf("%d %d %d", &l, &r, &c);
        insert(l, r, c);  //进行差分
    }

    for (int i = 1; i <= n; i++)
        b[i] += b[i - 1];  //将差分的数组转换为原数组
    for (int i = 1; i <= n; i++)
        printf("%d ", b[i]);
    return 0;
}